package cn.zhentao.charge.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.zhentao.charge.mapper.ChargePayOrderMapper;
import cn.zhentao.charge.domain.ChargePayOrder;
import cn.zhentao.charge.service.IChargePayOrderService;

/**
 * 支付单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-15
 */
@Service
public class ChargePayOrderServiceImpl implements IChargePayOrderService 
{
    @Autowired
    private ChargePayOrderMapper chargePayOrderMapper;

    /**
     * 查询支付单
     * 
     * @param id 支付单主键
     * @return 支付单
     */
    @Override
    public ChargePayOrder selectChargePayOrderById(Long id)
    {
        return chargePayOrderMapper.selectChargePayOrderById(id);
    }

    /**
     * 查询支付单列表
     * 
     * @param chargePayOrder 支付单
     * @return 支付单
     */
    @Override
    public List<ChargePayOrder> selectChargePayOrderList(ChargePayOrder chargePayOrder)
    {
        return chargePayOrderMapper.selectChargePayOrderList(chargePayOrder);
    }

    /**
     * 新增支付单
     * 
     * @param chargePayOrder 支付单
     * @return 结果
     */
    @Override
    public int insertChargePayOrder(ChargePayOrder chargePayOrder)
    {
        chargePayOrder.setCreateTime(DateUtils.getNowDate());
        return chargePayOrderMapper.insertChargePayOrder(chargePayOrder);
    }

    /**
     * 修改支付单
     * 
     * @param chargePayOrder 支付单
     * @return 结果
     */
    @Override
    public int updateChargePayOrder(ChargePayOrder chargePayOrder)
    {
        chargePayOrder.setUpdateTime(DateUtils.getNowDate());
        return chargePayOrderMapper.updateChargePayOrder(chargePayOrder);
    }

    /**
     * 批量删除支付单
     * 
     * @param ids 需要删除的支付单主键
     * @return 结果
     */
    @Override
    public int deleteChargePayOrderByIds(Long[] ids)
    {
        return chargePayOrderMapper.deleteChargePayOrderByIds(ids);
    }

    /**
     * 删除支付单信息
     * 
     * @param id 支付单主键
     * @return 结果
     */
    @Override
    public int deleteChargePayOrderById(Long id)
    {
        return chargePayOrderMapper.deleteChargePayOrderById(id);
    }
}
